﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<List<MensUnoShop.Models.UTag>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="main-content" class="hastable">
		    <div class="title title-spacing">
			    <h2>標籤清單</h2>
                自由定義標籤管理
		    </div>
            <form action="" method="post">
            <input type="hidden" name="Act" value="<%:ViewData["action"] %>" />
            <input type="hidden" name="tagid" value="<%:TempData["tagid"] %>" />
            <table cellspacing="0" style="width:710px;">
                <tr>
					<th style="width:30px">標籤名</th>
					<td style="width:500px;text-align:left">
                        <input type="text" name="title" value="<%:TempData["title"] %>" />
                        <input type="submit" value="<%:ViewData["bmsg"] %>" />
                    </td>
				</tr>
            </table>
            </form>
            快速搜尋：<input type="text" id="search" onkeyup="searchTag($(this).val());" style="margin-bottom:10px;" />

            <table cellspacing="0" style="width:810px;" id="taglist">
            <thead>
				<tr>
					<td style="width:30px">序號</td>
					<td style="width:70px">標籤編號</td>
                    <td style="width:200px;text-align:left">標籤</td>
                    <td style="width:50px">狀態</td>
                    <td style="width:300px">操作</td>
				</tr>
			</thead>
            <%if (Model != null){%>
             <tbody>
            <%for (int i = 0; i < Model.Count;i++ )
              {  %>
                <tr>
					<td class="a" ><%:(i+1) %></td>
					<td class="center"><%:Model[i].TAGid %></td>
                    <td class="ttitle"><%:Model[i].TAGtitle %></td>
                    <td class="center" style="padding:0"><%:Model[i].TAGstatus==true?"顯示":"隱藏" %></td>
                    <td >
                        <form action="" method="post" style="display:inline">
                            <input type="hidden" name="tagid" value="<%:Model[i].TAGid %>" />
                            <input type="hidden" name="Act" value="ChgStatus" />
                            <%if(Model[i].TAGstatus){ %><input type="submit" name="cstatus" value="隱藏" /><%}else{ %><input type="submit" name="cstatus" value="開啟" /><%} %>
                        </form>
                        <form action="" method="post" onsubmit="return confirm('確定刪除?');" style="display:inline">
                            <input type="hidden" name="tagid" value="<%:Model[i].TAGid %>" />
                            <input type="hidden" name="Act" value="Del" />
                            <input type="submit" name="cstatus" value="刪除" />
                        </form>
                        <form action="" method="post" style="display:inline">
                            <input type="hidden" name="tagid" value="<%:Model[i].TAGid %>" />
                            <input type="hidden" name="Act" value="Upt" />
                            <input type="submit" name="cstatus" value="修改" />
                        </form>
                        <input type="button" value="挑選商品" onclick="location.href='/Admin/TagSetup/choice/<%:Model[i].TAGid %>'" />
                        <input type="button" value="指派分類" onclick="location.href='/Admin/TagSetup/appoint/<%:Model[i].TAGid %>'" />
                    </td>
				</tr>
            <%} %>
            </tbody>
            <%} %>
            </table>

            <br/><br/>　
        </div>
        
</asp:Content>
